<?php
/**
 * Created by linzhonghuang.
 * Github: git@github.com:lichtung/Sharina.git
 * Email: 784855684@qq.com
 * Date: 2016/12/11
 * Time: 16:10
 */

namespace application\module\explorer\libs;


use wshore\core\Storage;
use wshore\helper\traits\Singleton;

class Member extends FileCache
{
    use Singleton;

    function __construct()
    {
        if (!is_file($file = WS_PATH_DATA . 'explorer/member.php')) {
            Storage::write($file, '<?php exit;?>{"admin":{"name":"admin","password":"21232f297a57a5a743894a0e4a801fc3","role":"root","status":0},"guest":{"name":"guest","password":"084e0343a0486ff05530df6c705c8bb4","role":"guest","status":0},"demo":{"name":"demo","password":"fe01ce2a7fbac8fafaed7c982a04e229","role":"default","status":0}}');
        }

        is_file($file2 = WS_PATH_DATA . 'explorer/User/admin/data/config.php') or Storage::write($file2, '<?php exit;?>{"list_type":"icon","list_sort_field":"name","list_sort_order":"up","theme":"simple\/","codetheme":"clouds","wall":"11","musictheme":"mp3player","movietheme":"webplayer"}');
        is_file($file2 = WS_PATH_DATA . 'explorer/User/admin/data/editor_config.php') or Storage::write($file2, '<?php exit;?>{"font_size":"15px","theme":"clouds","auto_wrap":0,"display_char":0,"auto_complete":1,"function_list":1}');
        is_file($file2 = WS_PATH_DATA . 'explorer/User/admin/data/fav.php') or Storage::write($file2, '');
        is_file($file2 = WS_PATH_DATA . 'explorer/User/admin/data/share.php') or Storage::write($file2, '');

        parent::__construct($file);
    }
}